﻿<Wpf:ServerControlTabContentControl x:Class="TMSPS.TRC.Controls.ServerInfoTabContentControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:Wpf="clr-namespace:TMSPS.TRC.BL.Wpf"
    x:Name="OwnControl" Loaded="ServerInfoTabContentControl_Loaded"                                 
    MinHeight="300" MinWidth="450">
    <Wpf:ServerControlTabContentControl.Resources>
        <BooleanToVisibilityConverter x:Key="BoolToVisibilityConverter" />
    </Wpf:ServerControlTabContentControl.Resources>
    <Grid>
        <DockPanel>
            <TextBlock DockPanel.Dock="Top" HorizontalAlignment="Center" FontSize="20" Foreground="Coral" FontWeight="ExtraBold">Server information</TextBlock>  
            <Button Name="ReconnectButton" DockPanel.Dock="Top" Content="Reconnect" Margin="10" MinWidth="125" HorizontalAlignment="Center" 
                    Visibility="{Binding Converter={StaticResource BoolToVisibilityConverter}, ElementName=OwnControl ,Path=IsDisconnected}" BorderBrush="Coral" Background="Azure" FontWeight="Bold" Click="ReconnectButton_Click" />
            
            <WrapPanel IsEnabled="{Binding ElementName=OwnControl, Path=IsConnected}" >
                <GroupBox Header="Information" MinWidth="300" Margin="5"  >
                    <DockPanel>
                        <WrapPanel DockPanel.Dock="Bottom">
                            
                        </WrapPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            
                            <StackPanel Grid.Row="0" Grid.Column="0" Margin="5" >
                                <TextBlock HorizontalAlignment="Right">Server status:</TextBlock>
                                <TextBlock HorizontalAlignment="Right">Server name:</TextBlock>
                                <TextBlock HorizontalAlignment="Right">Server version:</TextBlock>
                                <TextBlock HorizontalAlignment="Right">Server IP:</TextBlock>
                                <TextBlock HorizontalAlignment="Right">Players:</TextBlock>
                                <TextBlock HorizontalAlignment="Right">Ladder limit:</TextBlock>
                                <TextBlock HorizontalAlignment="Right">Current challenge:</TextBlock>
                                <TextBlock HorizontalAlignment="Right">Internet server:</TextBlock>
                            </StackPanel>
                            
                            <StackPanel Grid.Row="0" Grid.Column="1" Margin="5">
                                <TextBlock Name="ServerStatusTextBlock">-</TextBlock>
                                <TextBlock Name="ServerNameTextBlock">-</TextBlock>
                                <TextBlock Name="ServerVersionTextBlock">-</TextBlock>
                                <TextBlock Name="ServerIPTextBlock">-</TextBlock>
                                <TextBlock Name="PlayersTextBlock">-</TextBlock>
                                <TextBlock Name="LadderLimitTextBlock">-</TextBlock>
                                <TextBlock Name="CurrentChallengeTextBlock">-</TextBlock>
                                <CheckBox Name="IsInternetServerCheckBox" VerticalAlignment="Bottom" IsEnabled="False" />
                            </StackPanel>
                        </Grid>
                    </DockPanel>
                </GroupBox>
                
                <GroupBox Header="Network" MinWidth="300" Margin="5">
                    <DockPanel>
                        <WrapPanel DockPanel.Dock="Bottom">

                        </WrapPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>

                            <StackPanel Grid.Row="0" Grid.Column="0" Margin="5">
                                <TextBlock HorizontalAlignment="Right">Server uptime:</TextBlock>
                                <TextBlock HorizontalAlignment="Right">Connections:</TextBlock>
                                <TextBlock HorizontalAlignment="Right">Average connection time:</TextBlock>
                                <TextBlock HorizontalAlignment="Right">Avgerage players:</TextBlock>
                                <TextBlock HorizontalAlignment="Right">RecvNetRate:</TextBlock>
                                <TextBlock HorizontalAlignment="Right">Total receiving size:</TextBlock>
                                <TextBlock HorizontalAlignment="Right">SendNetRate:</TextBlock>
                                <TextBlock HorizontalAlignment="Right">Total sending size:</TextBlock>
                            </StackPanel>

                            <StackPanel Grid.Row="0" Grid.Column="1" Margin="5">
                                <TextBlock Name="UptimeTextBlock">-</TextBlock>
                                <TextBlock Name="ConnectionsTextBlock">-</TextBlock>
                                <TextBlock Name="AvgConnectionTimeTextBlock">-</TextBlock>
                                <TextBlock Name="AvgPlayersTextBlock">-</TextBlock>
                                <TextBlock Name="RecvNetRateTextBlock">-</TextBlock>
                                <TextBlock Name="TotalReceivingSizeTextBlock">-</TextBlock>
                                <TextBlock Name="SendNetRateTextBlock">-</TextBlock>
                                <TextBlock Name="TotalSendingSizeTextBlock">-</TextBlock>
                            </StackPanel>
                        </Grid>
                    </DockPanel>
                </GroupBox>
            </WrapPanel>
        </DockPanel>
    </Grid>
</Wpf:ServerControlTabContentControl>